<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="${pageContext.request.contextPath }/">
<script type="text/javascript" src="js/register.js"></script>
<title>Insert title here</title>
<style>
.inputstyle1 {
	width: 280px;
	height: 20px;
	border: 1px solid gray;
}
body {
	font-size: 14px;
}
</style>
<script language="javascript" type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="153" height="48"><img src="images/groupmanagerlogo.gif" width="153" height="48"></td>
                <td background="images/maintitle-bg.gif">&nbsp;</td>
                <td width="80"><img src="images/maintitle-right.gif" width="80" height="48"></td>
              </tr>
</table>
	<div style="width: 800px; margin: 10px auto; color: #F00">
		
	</div>
	<form action="updateUserServlet?id=${useredit.userid}" method="post" name="form1">
		<table style="background-color: #999" width="800" border="0"
			align="center" cellpadding="3" cellspacing="1">
			<caption>用户编辑</caption>
			<tr>
				<td width="200" height="40" align="right" bgcolor="#F5F5F5">用户名：</td>
				<td width="300" bgcolor="#F5F5F5"><label for="userName"></label>
					<input name="userName" type="text" class="inputstyle1"
					id="userName" value="${useredit.username }" onblur="checkName()"></td>
				<td bgcolor="#F5F5F5" style="color:red;">
				   <c:forEach items="${list }" var="item">
				       <c:if test="${item eq '1'}">*用户名不能为空</c:if>
				       <c:if test="${item eq '2'}">*用户名长度不符(6~18)</c:if>
				       <c:if test="${item eq '6'}">*该用户名已经被注册了</c:if>
				   </c:forEach>
				</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">密 码：</td>
				<td bgcolor="#F5F5F5"><input name="userPass" type="password"
					class="inputstyle1" id="userPass" value="${useredit.userpass }" onblur="checkPass()"></td>
				<td bgcolor="#F5F5F5" style="color:red;" id="tdUserpass">
				   <c:forEach items="${list }" var="item">
				       <c:if test="${item eq '3'}">*密码不能为空</c:if>
				       <c:if test="${item eq '4'}">*密码长度不符(6~18)</c:if>
				       <c:if test="${item eq '5'}">*密码不能是纯数字的,只能是数字和字符的组合</c:if>
				   </c:forEach>
				</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">真实姓名：</td>
				<td bgcolor="#F5F5F5"><input name="userTrueName" type="text"
					class="inputstyle1" id="userTrueName" value="${useredit.truename }"></td>
				<td bgcolor="#F5F5F5" style="color:red;"></td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">年 龄：</td>
				<td bgcolor="#F5F5F5"><input name="age" type="text"
					class="inputstyle1" id="age" value="${useredit.age }"></td>
				<td bgcolor="#F5F5F5" style="color:red;">&nbsp;</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">性 别：</td>
				<td bgcolor="#F5F5F5" ><input type="radio" name="gender" 
					value="男" <c:if test="${useredit.gender eq '男'}">checked="checked"</c:if> >男&nbsp;&nbsp; <input type="radio" name="gender"
					value="女" <c:if test="${useredit.gender eq '女'}">checked="checked"</c:if> >女</td>
				<td bgcolor="#F5F5F5" style="color:red;">&nbsp;</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">爱 好：</td>
				<td bgcolor="#F5F5F5"><input type="checkbox" name="favorite"
					value="打篮球" 
					<c:forEach items="${favorites}" var="item">
					    <c:if  test="${item eq '打篮球'}">checked="checked"</c:if>
					</c:forEach>  > 打篮球 <input type="checkbox" name="favorite"
					value="提篮球" 
					<c:forEach items="${favorites}" var="item">
					    <c:if  test="${item eq '提篮球'}">checked="checked"</c:if>
					</c:forEach>
					> 提篮球 <input type="checkbox" name="favorite"
					value="玩篮球" 
					<c:forEach items="${favorites}" var="item">
					    <c:if  test="${item eq '玩篮球'}">checked="checked"</c:if>
					</c:forEach>
					> 玩篮球 <input type="checkbox" name="favorite"
					value="拍篮球" 
					<c:forEach items="${favorites}" var="item">
					    <c:if  test="${item eq '拍篮球'}">checked="checked"</c:if>
					</c:forEach>
					> 拍篮球</td>
				<td bgcolor="#F5F5F5" style="color:red;">&nbsp;</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">电话：</td>
				<td bgcolor="#F5F5F5"><input 
					name="phone" type="text" class="inputstyle1" id="phone" value="${useredit.phone }"></td>
				<td bgcolor="#F5F5F5" style="color:red;">&nbsp;</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">地址：</td>
				<td bgcolor="#F5F5F5"><input 
					name="address" type="text" class="inputstyle1" id="address" value="${useredit.address }"></td>
				<td bgcolor="#F5F5F5" style="color:red;">&nbsp;</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">角色ID：</td>
				<td bgcolor="#F5F5F5"><input 
					name="roleid" type="number" max="2" min="1" class="inputstyle1" id="roleid" value="${useredit.roleid}"></td>
				<td bgcolor="#F5F5F5" style="color:red;">1表示超级管理员2表示普通管理员</td>
			</tr>
			<tr>
				<td height="40" align="right" bgcolor="#F5F5F5">用户活动状态：</td>
				<td bgcolor="#F5F5F5"><input 
					name="state" type="number" max="1" min="0" class="inputstyle1" id="state" value="${useredit.state}"></td>
				<td bgcolor="#F5F5F5" style="color:red;">0表示冻结1表示正常</td>
			</tr>
			<tr>
				<td height="150" align="right" bgcolor="#F5F5F5">备注：</td>
				<td bgcolor="#F5F5F5" height="150"><textarea rows="30" cols="50"  style="height: 100px"
					name="demo" class="inputstyle1" id="demo" >${useredit.demo }</textarea>
				<td bgcolor="#F5F5F5" style="color:red;"></td>
			</tr>
			<tr>
				<td bgcolor="#F5F5F5" style="color:red;">
				<c:forEach items="${list }" var="item">
						<c:if test="${item eq '7'}">*向数据库中更新数据出错了</c:if>
						<c:if test="${item eq '8'}">*更新成功</c:if>
				</c:forEach>
				</td>
				<td height="40" colspan="2" bgcolor="#F5F5F5"><input
					type="submit" name="button" id="button" value="保   存" onclick="return confirm('确定修改吗?')">
					&nbsp;&nbsp;  <input name="button"
						type="button" class="submitbutton" onclick="location.href='userlistServlet'" 
						value="返    回" /></td>
			</tr>
		</table>
	</form>
	<br />
</body>
</html>